<template>
  <div>
    {{ count }}
    <hr />
    <button @click="incr">自增一下</button>
  </div>
</template>

<script>
import { mapState } from "vuex";
import { ADMIN_INCR } from "../store/types";

export default {
  data() {
    return {};
  },
  computed: {
    ...mapState("admin", ["user", "count"]),
  },
  methods: {
    incr() {
      // 命名空间名称，一般项目就是目录
      this.$store.dispatch(ADMIN_INCR);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
